#include "DialogNavigator.h"

using namespace LightChart;

DialogNavigator& DialogNavigator::get_instance()
{
    static DialogNavigator instance;
    return instance;
}

void DialogNavigator::previous()
{
    (*current).hide();
    if (current != begin())
        (*--current).show();
}
void DialogNavigator::next()
{
    (*current).hide();
    if (++current != end())
	(*++current).show();
}
QDialog& DialogNavigator::get_next() const
{
    iterator tmp = current;
    if(++tmp != end())
	return *tmp;
    else return *current;
}

void DialogNavigator::launch()
{
    current = begin();
    (*current).show();
}
